﻿namespace DI.WebApi.Service;

/// <summary>
/// 单例服务示例
/// </summary>
public interface ISingletonDemo {
    ServiceLifetime Lifetime => ServiceLifetime.Singleton;
}

/// <summary>
/// 域服务示例
/// </summary>
public interface IScopedDemo {
    ServiceLifetime Lifetime => ServiceLifetime.Scoped;
}

/// <summary>
/// 瞬态服务示例
/// </summary>
public interface ITransientDemo {
    ServiceLifetime Lifetime => ServiceLifetime.Transient;
}


// ======================================================

public class SingletonDemo: ISingletonDemo {}

public class ScopedDemo : IScopedDemo { }

public class TransientDemo : ITransientDemo { }